package com.nf.action;

import com.nf.service.UserService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller
@Scope("prototype")
public class UserAction extends ActionSupport{

    @Autowired
    private UserService userService=null;
    @Override
    public String execute() throws Exception{
        String name = userService.getUserNameById("123");
        ActionContext context=ActionContext.getContext();
        context.getValueStack().set("name",name);

        return this.SUCCESS;
    }

}
